export class GoodConfig {

    public static GoodType = {
        Gem: 1,
        BeVip: 2,
        ChangeVip: 3,
        Coins: 4,
    }

    public static GoodAddType = {
        gems: "gems",
        coins: "coins"
    }

    public id: number = 0;
    public chargenum: number = 0; //钻石
    public rmb: number = 0; //
    public good_type: number = 0;
    public goodAddType: string = ""


    constructor(id: number, chargenum: number, rmb: number, good_type: number, goodAddType: string) {
        this.id = id;
        this.chargenum = chargenum;
        this.rmb = rmb;
        this.good_type = good_type
        this.goodAddType = goodAddType
    }


    public static configMap: Map<number, GoodConfig> = new Map<number, GoodConfig>()
        .set(1, new GoodConfig(1, 200, 20, GoodConfig.GoodType.Gem, GoodConfig.GoodAddType.gems))
        .set(2, new GoodConfig(2, 520, 50, GoodConfig.GoodType.Gem, GoodConfig.GoodAddType.gems))
        .set(3, new GoodConfig(3, 1100, 100, GoodConfig.GoodType.Gem, GoodConfig.GoodAddType.gems))
        .set(4, new GoodConfig(4, 2300, 200, GoodConfig.GoodType.Gem, GoodConfig.GoodAddType.gems))

        .set(5, new GoodConfig(5, 0, 60, GoodConfig.GoodType.BeVip, GoodConfig.GoodAddType.gems))
        .set(6, new GoodConfig(6, 0, 50, GoodConfig.GoodType.ChangeVip, GoodConfig.GoodAddType.gems))
        .set(7, new GoodConfig(7, 300000, 30, GoodConfig.GoodType.Coins, GoodConfig.GoodAddType.coins))
        .set(8, new GoodConfig(8, 500000, 50, GoodConfig.GoodType.Coins, GoodConfig.GoodAddType.coins))
        .set(9, new GoodConfig(9, 1000000, 100, GoodConfig.GoodType.Coins, GoodConfig.GoodAddType.coins))
        .set(10, new GoodConfig(10, 2000000, 200, GoodConfig.GoodType.Coins, GoodConfig.GoodAddType.coins))
        .set(11, new GoodConfig(11, 5000000, 500, GoodConfig.GoodType.Coins, GoodConfig.GoodAddType.coins))
        .set(12, new GoodConfig(12, 10000000, 1000, GoodConfig.GoodType.Coins, GoodConfig.GoodAddType.coins))

    public getGooName() {
        if (this.good_type == GoodConfig.GoodType.Gem) {
            return "钻石"
        }
        else if (this.good_type == GoodConfig.GoodType.BeVip) {
            return "成为VIP"
        }
        else if (this.good_type == GoodConfig.GoodType.ChangeVip) {
            return "换绑VIP"
        }
        else if (this.good_type == GoodConfig.GoodType.Coins) {
            return "金豆"
        }
    }

}